home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / 3dlib15.zip / HDR3DW.PAS < prev    next >
Pascal/Delphi Source File  |  1992-10-27  |  3KB  |  86 lines

  1. (******************************************************************************
  2. *                                    hdr3dw                                   *
  3. * This unit includes the headers needed for 3D manipulation ..                *
  4. ******************************************************************************)
  5. unit hdr3dw;
  6.  
  7. interface
  8.  
  9. const
  10.     MaxPoints  = 20;
  11.     MaxLines   = 50;
  12.     maxObjects = 9; {size of object table}
  13.     maxNest    = 10; {size of loop table of interpreter}
  14.  
  15. const ScreenWidth = 1000;
  16.       HalfWidth   = screenWidth / 2;
  17.  
  18.       radFactor = 180 / 3.1415926535897932385;
  19.  
  20. type
  21.     Line3d  = record
  22.        FromP, ToP  : integer;
  23.     end;
  24.     screenPoints = record
  25.        sX,sY : integer;
  26.     end;
  27.     axisType = (x,y,z);
  28.  
  29. type
  30.     point3d = record
  31.        x, y, z     : real;
  32.     end;
  33.  
  34. const
  35.        zeroPoint : point3d = (x:0.0; y:0.0; z:0.0);
  36.        xAxis : integer = 45;
  37.        yAxis : integer = 45;
  38.  
  39. var
  40.        cosine_x,cosine_y,sine_x,sine_y : Real;
  41.        currentPath : string[32];
  42.        MaxX, MaxY : word;          { In pixels for graphics screen }
  43.        MaxColor   : word;
  44. const
  45.        currentAxis : axisType = x;
  46.  
  47.  
  48. Procedure CalcAxisDeg;
  49. procedure setDefaultSuffix(var Fname : string; suffix : string);
  50.  
  51. implementation
  52.  
  53. (******************************************************************************
  54. *                                 CalcAxisDeg                                 *
  55. * calculate sines and cosines of axis, xAxis + yAxis = 90 !                   *
  56. ******************************************************************************)
  57. Procedure CalcAxisDeg;
  58. begin
  59.      Cosine_X := cos(Xaxis/RadFactor);
  60.      Cosine_Y := cos(Yaxis/RadFactor);
  61.      Sine_X   := sin(Xaxis/RadFactor);
  62.      Sine_Y   := sin(Yaxis/RadFactor);
  63. end; {calcAxisDeg}
  64.  
  65. (*******************************************************************************
  66. *                              setDefaultSuffix                                *
  67. *   Set the suffix if Fname to .suffix, if it does not have a suffix           *
  68. *******************************************************************************)
  69. procedure setDefaultSuffix;
  70. var
  71.     i  : integer;
  72. begin
  73.     i := length(Fname);
  74.     while (i > 0) and (Fname[i] <> '.') do
  75.        dec(i);
  76.     if (i = 0) then
  77.        Fname := Fname + '.' + suffix;
  78. end; {setDefaultSuffix}
  79.  
  80. (******************************************************************************
  81. *                                    end.                                     *
  82. ******************************************************************************)
  83. begin
  84.        calcAxisDeg;
  85. end.
  86.